<!DOCTYPE html>
<!--suppress ThymeleafVariablesResolveInspection-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all" />
    <script th:src="@{/layui/layui.js}"></script>
    <script th:src="@{/js/register/jquery-3.1.0.min.js}"></script>
</head>
<style>
    ::-webkit-scrollbar {display:none}
</style>
<body>
<form class="layui-form" action="">
    <input  name="studid" type="hidden" th:value="${student.Studid}"/>
    <div class="layui-form-item" style="margin-top: 20px">
        <label class="layui-form-label">学生姓名</label>
        <div class="layui-input-block">
            <!--学生姓名获取-->
            <input type="text" name="stuname" class="layui-input" disabled="disabled" th:value="${student.stuname}">
        </div>
    </div>
    在校情况：<textarea class="layui-textarea" name="caserecord"></textarea>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
<script type="text/javascript">
    layui.use(['laydate','form'],function () {
        var form = layui.form;
        var laydate = layui.laydate;

        form.on('submit(formDemo)', function(data){
            $.ajax({
                url: '/stu/adda',
                type: 'post',
                data:data.field,
                dataType: 'json',
                success:function(data){
                    if(data){
                        layer.msg(JSON.stringify("添加成功"));
                        //先得到当前iframe层的索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //再执行关闭
                        parent.layer.close(index);
                        window.parent.location.reload();
                    }
                },
            })
            //$('.layui-laypage-btn').click();//刷新
            return false;
        });
    });
</script>
</html>